<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>

    // let  recursion = function(i){
    //   if (i<1)return 0
    //   return i + recursion(i-1)
    // }
    //   console.log(recursion(100))

    // function getSum(num1,num2){
    //   document.write(num1+num2)
    // }
    // getSum(10,20)


    let x = +prompt("请输入第一个数")   
    let y = +prompt("请输入二个数")
    function getSum(x,y){
      let sum = 0
      for(let i =x; i<=y; i++) {
        sum +=i
      }
      return sum 
    }
    document .write(`${x}-${y}之间的所有数的和：${getSum(x,y)}`)
  </script>
</body>
</html>